﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using ConstellationShow.Function.DocData;
using System.Xml.Linq;
using System.IO;

namespace ConstellationShow.Pages
{
    public partial class Pair : MyPage
    {
        int id1;
        int id2;
        string texts;
        public Pair()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(Pair_Loaded);
        }

        void Pair_Loaded(object sender, RoutedEventArgs e)
        {
            id1 = Convert.ToInt32(NavigationContext.QueryString["id1"]);
            id2 = Convert.ToInt32(NavigationContext.QueryString["id2"]);
            img1.Tag = "/Images/" + Com.ConsImg(id1);
            img1.Content = Info.ConvStr(id1.ToString());
            PageTitle.Text = img1.Content.ToString();
            img2.Tag = "/Images/" + Com.ConsImg(id2);
            img2.Content = Info.ConvStr(id2.ToString());
            int[] count = { };
            string text = "";
            if (id1 == 0)
            {
                text = PairData.getBaiYang(id2);
                count = PairData.getBaiYangCount(id2);
            }
            else if (id1 == 1)
            {
                text = PairData.getJinNiu(id2);
                count = PairData.getJinNiuCount(id2);
            }
            else if (id1 == 2)
            {
                text = PairData.getShuangZi(id2);
                count = PairData.getShuangZiCount(id2);
            }
            else if (id1 == 3)
            {
                text = PairData.getJuXie(id2);
                count = PairData.getJuXieCount(id2);
            }
            else if (id1 == 4)
            {
                text = PairData.getShiZi(id2);
                count = PairData.getShiZiCount(id2);
            }
            else if (id1 == 5)
            {
                text = PairData.getChuNv(id2);
                count = PairData.getChuNvCount(id2);
            }
            else if (id1 == 6)
            {
                text = PairData.getTianCheng(id2);
                count = PairData.getTianChengCount(id2);
            }
            else if (id1 == 7)
            {
                text = PairData.getTianXie(id2);
                count = PairData.getTianXieCount(id2);
            }
            else if (id1 == 8)
            {
                text = PairData.getSheShou(id2);
                count = PairData.getSheShouCount(id2);
            }
            else if (id1 == 9)
            {
                text = PairData.getMoJie(id2);
                count = PairData.getMoJieCount(id2);
            }
            else if (id1 == 10)
            {
                text = PairData.getShuiPing(id2);
                count = PairData.getShuiPingCount(id2);
            }
            else if (id1 == 11)
            {
                text = PairData.getShuangYu(id2);
                count = PairData.getShuangYuCount(id2);
            }
            s1.mark = count[0];
            s2.mark = count[1];
            s3.mark = count[2];
            s4.mark = count[3];
            txt.Text = text;
            texts = text;
        }

        private void Click_Share(object sender, EventArgs e)
        {
            Com.Share(Info.ConvStr(id1.ToString()) + "和" + Info.ConvStr(id2.ToString()), texts);
        }

        private void Click_Home(object sender, EventArgs e)
        {
            NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }


    }
}